package com.asiainfo_linkage.runtask;

//import java.util.Calendar;
//import java.util.Date;
//import java.util.List;
import java.util.Timer;
import org.nutz.ioc.loader.annotation.IocBean;

@IocBean
public class MyTimerTask implements MyScheduler{
private static Timer timer = new Timer();

@Override
public void schedule(MyTask mytask) {
//初始化监听器，在tomcat启动的时候监听器启动
	timer = new Timer(true);
	//凌晨 01:00:00执行任务
	/*Calendar calendar = Calendar.getInstance();
	calendar.set(Calendar.HOUR_OF_DAY, 21);
	calendar.set(Calendar.MINUTE, 43);
	calendar.set(Calendar.SECOND, 05);
	Date time = calendar.getTime();*/
	timer.schedule(mytask,0,60*1000);//调用exportHistoryBean，0表示任务无延迟，5*1000表示每隔5秒执行任务，60*60*1000表示一小时；
	}
}
